package xtgl;

import com.jfinal.plugin.activerecord.Model;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Log extends Model<Log> {
	
	public static final Log dao=new Log();
	
	public List<Log> getlogs() {
		List<Log> list = Log.dao.find("select * from log");
		return list;
	}
	
	//添加日志
		public static void addlog(String name,String czxm,String lx){
			/*User user= (User) getSession().getAttribute("user");*/
			String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
					.format(new Date());
			Log log=new Log();
			log.set("operation_user", name).set("czxm",czxm).set("operation_genre",lx).set("operation_time", time);
			log.save();
		}
	
}
